package cn.wolfcode.trip.api.controller;

import cn.wolfcode.trip.base.domain.StrategyComment;
import cn.wolfcode.trip.base.query.CommodityQueryObject;
import cn.wolfcode.trip.base.service.ICommodityService;
import cn.wolfcode.trip.base.util.JsonResult;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("commoditys")
public class CommodityController {
    @Autowired
    private ICommodityService commodityService;
    /**
     * 查找某种特定类型的商品
     * 资源:/commoditys
     * 请求方式:get
     * 请求参数:资源占位符(商品的种类)
     * 返回结果:pageInfo
     */
    @GetMapping
    public PageInfo selectByCommodityKind(@ModelAttribute("qo") CommodityQueryObject qo){
        return commodityService.query(qo);
    }
}
